<!DOCTYPE html>

<html>



<head>

	<meta charset="utf-8">

	<title></title>
	<meta name="renderer" content="webkit">

	<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">

	<meta name="viewport"

		content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">

	<link rel="stylesheet" href="/public/static/layuiadmin/layui/css/layui.css" media="all">

	<link rel="stylesheet" href="/public/static/layuiadmin/style/admin.css" media="all">

</head>



<body>

	<div class="layui-fluid">

		<div class="layui-card">

			<div class="layui-card-body" style="padding: 15px;">

				<form class="layui-form" action="{:url('Module/save')}" method="post" lay-filter="component-form-group" id="moduleForm">

					<div class="layui-form-item">

						<label class="layui-form-label">模块</label>

						<div class="layui-input-block">

							<select name="parent_id" id="parent_id" lay-verify="required" lay-filter="parent_id">

								<option value="0">顶级模块</option>

								{volist name="module" id="vo"}

								<option value="{$vo.id}">{$vo.title}</option>

								{if condition="$vo['children']"}

								{volist name="vo['children']" id="vos"}

								<option value="{$vos.id}">　┣{$vos.title}</option>

								{/volist}

								{/if}

								{/volist}

							</select>

						</div>

					</div>

					<div class="layui-form-item">

						<label class="layui-form-label">模块名称</label>

						<div class="layui-input-block">

							<input type="text" name="title" value="" lay-verify="required" placeholder="请输入模块名称"

								autocomplete="off" class="layui-input">

						</div>

					</div>

					<div class="layui-form-item">

						<label class="layui-form-label">英文名称</label>

						<div class="layui-input-block">

							<input type="text" name="en_name" value="" placeholder="请输入英文名称" autocomplete="off"

								class="layui-input">

						</div>

					</div>

					<div class="layui-form-item">

						<label class="layui-form-label">模块路径</label>

						<div class="layui-input-block">

							<input type="text" name="path" value="" placeholder="请输入模块路径" autocomplete="off"

								class="layui-input">

						</div>

					</div>

					<div class="layui-form-item">

						<label class="layui-form-label">前端路径</label>

						<div class="layui-input-block">
							<input type="text" name="web_path" value="" placeholder="请输入前端路径" autocomplete="off"
								class="layui-input">
						</div>

					</div>

					<div class="layui-form-item">

						<label class="layui-form-label">图标</label>

						<div class="layui-input-block">

							<input type="text" name="icon" value="" placeholder="请输入图标" autocomplete="off"

								class="layui-input">

						</div>

					</div>

					<div class="layui-form-item">

						<label class="layui-form-label">排序号</label>

						<div class="layui-input-block">

							<input type="text" name="orders" value="99999" lay-verify="required" placeholder="请输入排序号"

								autocomplete="off" class="layui-input">

						</div>

					</div>

					<div class="layui-form-item">

						<label class="layui-form-label">是否显示</label>

						<div class="layui-input-block">

							<input type="radio" name="show" value="1" title="显示" checked>

							<input type="radio" name="show" value="2" title="不显示">

						</div>

					</div>

					<div class="layui-form-item">

						<label class="layui-form-label">模块级别</label>

						<div class="layui-input-block">

							<select name="level" lay-filter="level">

								<option value="1">一级</option>

								<option value="2">二级</option>

								<option value="3">三级</option>

							</select>

						</div>

					</div>

					<div class="layui-form-item">

						<label class="layui-form-label">状态</label>

						<div class="layui-input-block">

							<input type="radio" name="status" value="1" title="正常" checked>

							<input type="radio" name="status" value="2" title="停用">

						</div>

					</div>

					<div class="layui-form-item" style="display: none;">

						<label class="layui-form-label">描述</label>

						<div class="layui-input-block">

							<script id="container" name="content" type="text/plain"></script>

						</div>

					</div>

					<div class="layui-form-item layui-layout-admin">

						<div class="layui-input-block">

							<div class="layui-footer" style="left: 0;">

								<button class="layui-btn" lay-submit="" lay-filter="component-form-demo1">保存</button>

							</div>

						</div>

					</div>

				</form>

			</div>

		</div>

	</div>

	<script src="/public/static/layuiadmin/layui/layui.js"></script>

	<!-- 编辑器源码文件 -->

	<script type="text/javascript" src="/public/static/layuiadmin/ueditor/ueditor.config.js"></script>

	<!-- 配置文件 -->

	<script type="text/javascript" src="/public/static/layuiadmin/ueditor/ueditor.all.js"></script>

	<!-- 实例化编辑器 -->

	<script type="text/javascript">

		var ue = UE.getEditor('container');

	</script>

	<script>

		layui.config({

			base: '/public/static/layuiadmin/' // 静态资源所在路径

		}).extend({

			index: 'lib/index', // 主入口模块

			api: 'api'

		}).use(['index', 'form', 'laydate', 'api'], function () {

			var $ = layui.$,

				admin = layui.admin,

				element = layui.element,

				layer = layui.layer,

				laydate = layui.laydate,

				api = layui.api,

				form = layui.form;



			form.render(null, 'component-form-group');



			/* 监听提交 */

			form.on('submit(component-form-demo1)', function (data) {

				var dats = data.field;

				var index = parent.layer.getFrameIndex(window.name); // 获取窗口索引

				dats.content = UE.getEditor('container').getContent();

				layer.msg('加载中', {

					icon: 16,

					shade: 0.01

				});

				api.ajax('{:url("Module/save")}', 'post', 'json', dats, function (res) {

					layer.closeAll('loading');

					layer.msg(res.msg);

					// $("#moduleForm")[0].reset();

					parent.tables.reloads();

				});

				return false;

			});

		});

	</script>

</body>



</html>